import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

export const myAutoImport = AutoImport({
    // targets to transform
    include: [
        /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
        /\.vue$/, /\.vue\?vue/, // .vue
        /\.md$/, // .md
    ],

    // global imports to register
    imports: [
        // presets
        'vue',
        'vue-router',
        // custom
        // {
        //     'axios': [
        //         // 如果暴露多个，可以直接写字符串
        //         // default imports
        //         ['default', 'axios'], // import { default as axios } from 'axios',
        //     ],
        // }
    ],
    defaultExportByFilename: false,
    resolvers: [
        ElementPlusResolver()
    ],
    eslintrc: {
        enabled: false, // 先关闭避免干扰
    },
})

export const myAutoComponents = Components({
    resolvers: [
        ElementPlusResolver()
    ]
})